<? $i = 0 ?>
<? foreach ($hoa_don as $rows): ?>
    <? $i++ ?>
    <tr>
        <td><?= $i; ?></td>
        <td><?= $rows->OID; ?></td>
        <td><?= date_format(date_create($rows->ODate), "d-m-Y") ?></td>
        <td><?= date_format(date_create($rows->OSDate), "d-m-Y"); ?></td>
        <td><?= $rows->OName; ?></td>
        <td><?= $rows->Amount; ?> VND</td>
        <? $opt = $rows->OStatus ?>
        <td>
            <? if ($opt != 2): ?>
                <? $option = array('0' => 'Chưa xử lý', '1' => 'Đang xử lý', '2' => 'Đã xử lý'); ?>
                <? if ($opt == 0) $select_array = array('0'); ?>
                <? if ($opt == 1) $select_array = array('1'); ?>
                <? if ($opt == 2) $select_array = array('2'); ?>
                <? echo form_dropdown('qlhdse8', $option, $select_array) ?>
            <? else: ?>
                <? echo "đã xử lý"; ?>
            <? endif; ?>
        </td>
        <td align="center"><a id="a1" href="<?= base_url(); ?>dienhoa-administrator/hoa_don/view/<?= $rows->OID ?>">Xem</a></td>
        <td align="center">
            <? if ($rows->OStatus == 0): ?>
                <a id='a1' href="<?= base_url(); ?>dienhoa-administrator/hoa_don/delete/<?= $rows->OID ?>" onclick="return confirm('Bạn có chắc chắn muốn xóa hóa đơn này không?');">Xóa</a>
            <? else: ?>
                <? echo "||"; ?>
            <? endif; ?>
        </td>
    </tr>
<? endforeach; ?>
</table>
<ul id="pagination_digg" class="ajax-pag">
    <li> <?= $pagination; ?></li>
</ul>